package com.atguigu.gmall.product.client;

import com.atguigu.gmall.model.product.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Author: 赵勇镔
 * @Time: 2021/5/17 20:55
 * @Description:
 */
//远程调用模块 fallback降级处理
@FeignClient(name = "service-product",fallback = DegradedProductFeignClient.class)
public interface ProductFeignClient {

    @GetMapping("/api/product/inner/getSkuInfo/{skuId}")
    SkuInfo getSkuInfo(@PathVariable Long skuId);

    @GetMapping("/api/product/inner/getBaseCategoryView/{category3Id}")
    BaseCategoryView getBaseCategoryView(@PathVariable Long category3Id);

    @GetMapping("/api/product/inner/getSpuSaleAttrValueChecked/{skuId}/{spuId}")
    List<SpuSaleAttr> getSpuSaleAttrValueChecked(@PathVariable Long skuId,
                                                        @PathVariable Long spuId);

    @GetMapping("/api/product/inner/getValuesSkuJson/{spuId}")
    Map getValuesSkuJson(@PathVariable Long spuId);

    @GetMapping("/api/product/inner/getPrice/{spuId}")
    BigDecimal getPrice(@PathVariable Long spuId);

    @GetMapping("/api/product/inner/getBaseCategoryViewList")
    List<BaseCategoryView> getBaseCategoryViewList();

    @GetMapping("/api/product/inner/getBaseTrademark/{id}")
    BaseTrademark getBaseTrademark(@PathVariable Long id);

    @GetMapping("/api/product/inner/getSkuAttrValue/{skuId}")
    List<SkuAttrValue> getSkuAttrValue(@PathVariable Long skuId);
}
